"""
系统常量模块
定义系统级别的常量
"""


class SystemConfig:
    """系统配置常量"""
    # 系统名称
    SYSTEM_NAME = "StarWeb认证系统"
    # API版本
    API_VERSION = "v1"
    # 默认分页大小
    DEFAULT_PAGE_SIZE = 10
    # 最大分页大小
    MAX_PAGE_SIZE = 100
    # 默认排序字段
    DEFAULT_SORT_FIELD = "created_at"
    # 默认排序方向（降序）
    DEFAULT_SORT_DIRECTION = "desc"
    # 当前环境变量值
    ENVIRONMENT_DEV = "development"
    ENVIRONMENT_TEST = "testing"
    ENVIRONMENT_PROD = "production"


class FileConfig:
    """文件相关常量"""
    # 上传文件最大大小（字节）: 10MB
    MAX_UPLOAD_SIZE = 10 * 1024 * 1024
    # 允许上传的文件类型
    ALLOWED_UPLOAD_EXTENSIONS = {
        "image": ["jpg", "jpeg", "png", "gif", "webp"],
        "document": ["pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt"],
        "archive": ["zip", "rar", "7z", "tar", "gz"],
        "media": ["mp3", "mp4", "avi", "mov", "wmv"]
    }
    # 文件上传目录
    UPLOAD_DIRECTORY = "uploads"
    # 临时文件目录
    TEMP_DIRECTORY = "temp"
    # 静态文件目录
    STATIC_DIRECTORY = "static"


class CacheConfig:
    """缓存相关常量"""
    # 默认缓存过期时间（秒）
    DEFAULT_EXPIRE = 60 * 60  # 1小时
    # 短期缓存过期时间（秒）
    SHORT_EXPIRE = 5 * 60  # 5分钟
    # 长期缓存过期时间（秒）
    LONG_EXPIRE = 24 * 60 * 60  # 1天
    # 永久缓存（不过期）
    PERMANENT_EXPIRE = -1
    # 缓存前缀
    CACHE_PREFIX = "starweb:"


class LogLevel:
    """日志级别常量"""
    DEBUG = "DEBUG"
    INFO = "INFO"
    WARNING = "WARNING"
    ERROR = "ERROR"
    CRITICAL = "CRITICAL"
